package com.itheima.Ws;

import java.io.*;
import java.net.Socket;
import java.util.Scanner;

public class Client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 1002);
        OutputStream os = socket.getOutputStream();
        OutputStreamWriter ous = new OutputStreamWriter(os);
        BufferedWriter bw = new BufferedWriter(ous);
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("输入：");
           String s = sc.nextLine();

            if (s.equals("886")) {
                break;
            }
            bw.write(s);
            bw.newLine();
            bw.flush();
        }

        bw.close();
        socket.close();

    }
}
